Induction of Relational Algebra Expressions
نویسندگان
چکیده
In the theory of database systems [1], a database query is defined as a function that maps relational databases to relations. This definition models the situation in practice where one applies an SQL query to a database instance and receives a set of output tuples as the answer to the query on that database. The problem of relational database query induction is then naturally stated as follows: we are presented with a finite number of examples, where each example consists of a relational database and an output relation, and we are asked to come up with an expression for a query that agrees with the given examples (and that satisfies the usual requirements placed on induction tasks, most notably generalization). Of course, we should also specify here which language we are using to express database queries. Whereas SQL is the universal query language used in practice, it is also very complex. A more tractable language to work with is the relational algebra, which can be found, together with SQL, in every database textbook, as the relational algebra is the basic underlying query language used for database query processing. Another common language in which relational database queries can be expressed is Datalog (function-free Prolog). Datalog is also used in Inductive Logic Programming (ILP), and when we restrict attention to nonrecursive programs, Datalog can be translated into the relational algebra [2, 3]. As a consequence, relational database query induction could be (and has been [4, 5]) considered to be a mere special case of ILP, where the background knowledge consists only of facts (the example databases). That approach, however, does not cover relational database query induction in its entirety, because not every relational algebra query can be expressed in Datalog. Nonrecursive Datalog without negation can only express the positive fragment of the relational algebra, i.e., the fragment without the set-theoretic difference operator. Consider, for example, the following rules over a binary relation r(A,B):
منابع مشابه
Relative Expressiveness of Typed and Untyped Relational Algebra
We consider relational databases with typed attributes and are interested in relational algebra expressions which always result in a relation of some xed type. Such expressions are called \type-safe". Type-safety is undecidable. We also consider \typed" relational algebra expressions, which are syntactically guaranteed to be type-safe. We then show that every expression is equivalent to a union...
متن کاملSimulation of the Nested Relational Algebra by the at Relational Algebra, with an Application to the Complexity of Evaluating Powerset Algebra Expressions
Paredaens and Van Gucht proved that the at relational algebra has the same expressive power as the nested relational algebra, as far as queries over at relations and with at results are concerned. We provide a new, very direct proof of this fact using a simulation technique. Our technique is also applied to partially answer a question posed by Suciu and Paredaens regarding the complexity of eva...
متن کاملManipulation of expression in a relational algebra
This paper describes a syntax for expressions based on the relational algebra. A tree representation is generated when an expression is analyzed. Transformations on the tree representations of expressions are applied in order to obtain improvements with respect to the speed of evaluation in a data base environment.
متن کاملA Relational Algebra for Functional Logic Deductive Databases
In this paper, we study the integration of functional logic programming and databases by presenting a data model, and a query and data definition language. The query and data definition language is based on the use of a set of algebra operators over an extended relational algebra. The algebra expressions built from the extended algebra are used for expressing queries and rules. In addition, alg...
متن کاملSubset Queries in Relational Databases
In this paper, we motivated the need for relational database systems to support subset query processing. We defined new operators in relational algebra, and new constructs in SQL for expressing subset queries. We also illustrated the applicability of subset queries through different examples expressed using extended SQL statements and relational algebra expressions. Our aim is to show the utili...
متن کامل